﻿using Basefr.Attributes;
using Paas.Core.Const.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Paas.Core.Meta.Entities
{
    /// <summary>
    /// 元数据字段
    /// </summary>
    [MainTable(nameof(MetaField))]
    public class MetaField: BaseEntity
    {
        /// <summary>
        /// 字段类型
        /// </summary>
        public MetaDataType? MetaDataType { get; set; }

        /// <summary>
        /// 对象所属的应用
        /// </summary>
        public int? ApplicationId { get; set; }

        /// <summary>
        /// 字段所属元对象id
        /// </summary>
        public string ObjectId { get; set; }

        
        public string Name { get; set; }

        /// <summary>
        /// 对象的显示名称，默认中文
        /// </summary>
        public string Label { get; set; }

        ///// <summary>
        ///// 应用名.对象名.字段名
        ///// </summary>
        //public string FullName { get; set; }
        
        /// <summary>
        /// 描述信息
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public DataType? DataType { get; set; }

        /// <summary>
        /// 是否必须(true:不允许为空；false：允许为空）
        /// </summary>
        public bool? IsRequired { get; set; }
        ///// <summary>
        ///// 字段长度
        ///// </summary>
        //public int? Length { get; set; }
        /// <summary>
        /// 字段默认值
        /// </summary>
        public string DefaultValue { get; set; }
        /// <summary>
        /// 元数据状态
        /// </summary>
        public MetaStatus? CurrentStatus { get; set; }

        /// <summary>
        /// 分组
        /// </summary>
        public string MetaFieldGroup { get; set; }

        ///// <summary>
        ///// 长度
        ///// </summary>
        //public int? MetaFieldLength { get; set; }

        /// <summary>
        /// 精度
        /// </summary>
        public int? MetaFieldPrecision { get; set; }
    }
}
